﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;
using System.Runtime.Serialization;
using System.Collections.ObjectModel;

namespace OS.GenericDashboardViewer.DataModel
{
    [DataContract]
    public class TextViewPart : ViewPart 
    {
        public TextViewPart()
        {
            Lines = new ObservableCollection<string>();
        }
        [DataMember]
        public string Text { get; set; }
        [DataMember]
        public double FontSize { get; set; }

        public FontFamily FontFamily
        {
            get
            {
                return new FontFamily(FontFamilyText);
            }
        }

        [DataMember]
        public string FontFamilyText { private get; set; }

        public Brush Foreground
        {
            get
            {
               
                return new SolidColorBrush((Color)(ColorConverter.ConvertFromString(this.ForegroundText)));
            }
        }
        [DataMember]
        public string ForegroundText {  private get; set; }
        public Brush Background
        {
            get
            {

                return new SolidColorBrush((Color)(ColorConverter.ConvertFromString(this.BackgroundText)));
            }
        }
        [DataMember]
        public string BackgroundText { private get; set; }

          [DataMember]
        public ObservableCollection<string> Lines { get; set; }

          [DataMember]
        public string Title { get; set; }
    }
}
